package com.atguigu.udmp.web.userprofile.mapper;

import com.atguigu.udmp.web.userprofile.bean.TaskInfo;
import com.atguigu.udmp.web.userprofile.constant.ConstCodes;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author zhangchen
 * @since 2023-11-10
 */
@Mapper
@DS("udmp")
public interface TaskInfoMapper extends BaseMapper<TaskInfo> {

    @Select("select  tk.*, tg.tag_value_type  from task_info tk join tag_info tg on tk.tag_id=tg.id " +
            " where tk.task_status ='"+ ConstCodes.TASK_STATUS_ON +"' and exec_cycle=#{execCycle} and exec_type='"+ ConstCodes.EXEC_TYPE_OLAP_SQL +"'" +
            "  order by task_exec_level asc")
    public List<TaskInfo> taskInfoListForOLAP(@Param("execCycle") String execCycle);

}
